﻿namespace MasterPageControlExample.Objects
{
    public class BasePage:System.Web.UI.Page
    {
        protected void DisplayHeader(bool value)
        {
            var masterPage = Master;
            if (masterPage != null)
            {
                var siteMaster = (masterPage as SiteMaster);
                if (siteMaster != null) siteMaster.DisplayHeader(value);
            }
        }

        protected void DisplayFooter(bool value)
        {
            var masterPage = Master;
            if (masterPage != null)
            {
                var siteMaster = (masterPage as SiteMaster);
                if (siteMaster != null) siteMaster.DisplayFooter(value);
            }
        }

        protected void SetSiteTitle(string siteTitle)
        {
            var masterPage = Master;
            if (masterPage != null)
            {
                var siteMaster = (masterPage as SiteMaster);
                if (siteMaster != null) siteMaster.SetSiteTitle(siteTitle);
            }
        }
    }
}